package org.oschina;

import org.oschina.bean.MessageBean;
import org.oschina.helper.JsonHelper;

public class Message {

	public final static String ERROR_DATA_ERROR="ERROR_DATA_ERROR";
	public final static String ERROR_UNAUTHORIZED="ERROR_UNAUTHORIZED";
	
	public final static String ERROR_APP_ERROR="ERROR_APP_ERROR";
	
	public final static String UPDATE_SUCCESS="UPDATE_SUCCESS";
	public final static String DELETE_SUCCESS="DELETE_SUCCESS";
	public final static String DELETE_SUCCESS_DELAY="DELETE_SUCCESS_DELAY";
	public final static String CHECK_SUCCESS="CHECK_SUCCESS";
	public final static String UPDATE_SUCCESS_DELAY="UPDATE_SUCCESS_DELAY";
	public final static String CREATE_SUCCESS_DELAY="CREATE_SUCCESS_DELAY";
	public final static String OPERATION_SUCCESS="OPERATION_SUCCESS";
	
	public final static String UPLOAD_ERROR_TYPE_ERROR="UPLOAD_ERROR_TYPE_ERROR";
	public final static String UPLOAD_ERROR_OUT_OF_SIZE="UPLOAD_ERROR_OUT_OF_SIZE";
	
	public final static String ROLE_UPDATE_SUCCESS="ROLE_UPDATE_SUCCESS";
	
	public final static String REGISTER_SUCCESS="REGISTER_SUCCESS";
	public final static String REGISTER_CHECK_SUCCESS="REGISTER_CHECK_SUCCESS";
	public final static String REGISTER_FAILURE_IS_CHECK="REGISTER_FAILURE_IS_CHECK";
	public final static String REGISTER_ERROR_USER_IS_EXIST="REGISTER_ERROR_USER_IS_EXIST";
	public final static String LOGIN_ERROR_USER_NOT_FOUND="LOGIN_ERROR_USER_NOT_FOUND";
	public final static String LOGIN_ERROR_PASSWORD_ERROR="LOGIN_ERROR_PASSWORD_ERROR";
	public final static String LOGIN_ERROR_USER_IS_ONLINE="LOGIN_ERROR_USER_IS_ONLINE";
	public final static String LOGOUT_SUCCESS="LOGOUT_SUCCESS";
	public final static String LOGOUT_FAILURE="LOGOUT_FILURE";
	public final static String SOFTWARE_ERROR_IS_EXIST="SOFTWARE_ERROR_IS_EXIST";
	public final static String USER_FOLLOW_CREATE_SUCCESS="USER_FOLLOW_CREATE_SUCCESS";
	public final static String USER_FOLLOW_CREATE_FAILURE_IS_EXIST="USER_FOLLOW_CREATE_FAILURE_IS_EXIST";
	public final static String USER_FOLLOW_CREATE_FAILURE_ONESELF="USER_FOLLOW_CREATE_FAILURE_ONESELF";
	public final static String USER_FOLLOW_DELETE_SUCCESS="USER_FOLLOW_DELETE_SUCCESS";
	public final static String USER_EDIT_USERNAME_IS_EXIST="USER_EDIT_USERNAME_IS_EXIST";
	public final static String USER_MAIL_CREATE_FAILURE_NOT_YOURSELF="USER_MAIL_CREATE_FAILURE_NOT_YOURSELF";
	public final static String USER_MAIL_CREATE_FAILURE_TARGET_NOT_FOUND="USER_MAIL_CREATE_FAILURE_TARGET_NOT_FOUND";
	
	public final static String USER_UPDATE_PASSWORD_FAILURE_SOURCE_PASSWORD_ERROR="USER_UPDATE_PASSWORD_FAILURE_SOURCE_PASSWORD_ERROR";
	
	public final static String FAVORITE_CREATE_SUCCESS="FAVORITE_CREATE_SUCCESS";
	public final static String FAVORITE_CREATE_FAILURE_IS_FAVORITE="FAVORITE_CREATE_FAILURE_IS_FAVORITE";
	public final static String FAVORITE_DELETE_SUCCESS="FAVORITE_DELETE_SUCCESS";
	
	/**
	 * 返回
	 * @param key
	 * @param args
	 * @return
	 */
	public static String get(String key,Object...args)
	{
		return JsonHelper.toJson(new MessageBean(key,args));
	}
}